﻿using System;
using System.Windows.Forms;
using KQReport.Utils;

namespace KQReport
{
    public partial class FmSettings : Form
    {
        public FmSettings()
        {
            InitializeComponent();
        }

        private void FmSettings_Load(object sender, EventArgs e)
        {
            textBox1.Text = Conf.Cn.Value;
            textBox2.Text = Conf.Analyse1.Value;
            textBox3.Text = Conf.Analyse2.Value;
            textBox4.Text = Conf.Analyse2TimeFormat.Value;
            textBox5.Text = Conf.Name.Value;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Conf.Cn.Value = textBox1.Text.Trim();
            Conf.Analyse1.Value = textBox2.Text.Trim();
            Conf.Analyse2.Value = textBox3.Text.Trim();
            Conf.Analyse2TimeFormat.Value = textBox4.Text.Trim();
            Conf.Name.Value = textBox5.Text.Trim();
            DialogResult = DialogResult.OK;
            Dialog.MsgOk(this, "设置成功，数据文件与分类名称重启后生效");
        }
    }
}